
import router from './router'
import { getToken } from './utils/token'
router.beforeEach((to, from, next) => {
  if (to.path == '/login' || to.path == '/register') {
    next();
  } else {
    if (getToken()) {
      next()
    }
    else {
      next({ path: '/login' });
    }
  }
})

